<template>
  <div class="product-desc">
    <p class="title">{{ detail.title }}</p>
    <p class="title_sub">{{ detail.title_sub }}</p>
    <p class="price" v-if="detail.area && +detail.area.area_id === 2">{{ +detail.price }}积分</p>
    <p class="price" v-else>￥{{ +detail.price }}</p>
    <p class="price_old">￥{{ +detail.price_old }}</p>
    <p class="stock">库存:{{ +detail.stock }}</p>
    <div class="qrcode" @click="$emit('qrcodeShare')">
      <i class="cubeic-qr-code"></i>
    </div>
<!--    <div class="tip" v-if="+detail.price === 399">一人限购一单</div>-->
<!--    <div class="tip" v-if="detail.scoreCost && +detail.scoreCost.total === 22">限购一盒</div>-->
  </div>
</template>

<script>
export default {
  name: 'ProductDescription',
  props: ['detail']
}
</script>

<style scoped lang="stylus">
.product-desc
  padding 10px
  margin 10px
  background white
  border-radius 10px
  text-align left
  color $main_text_color
  position relative
  .tip
    color red
    font-weight 700
    position absolute
    right 10px
    top 10px
    font-size 16px
    letter-spacing 2px
  p
    line-height 22px
    &.title
      font-weight 700
      font-size 16px
    &.title_sub
      color $second_text_color
    &.price
      font-size 20px
      font-weight 700
      color red
      line-height 30px
    &.price_old
      font-size 16px
      color $second_text_color
      text-decoration line-through
    &.stock
      font-size 14px
  .qrcode
    position absolute
    font-size 50px
    color $main_color
    right 15px
    bottom 15px
</style>
